<div class="m-user">
    <div class="g-hd">
        <div class="m-head g-fluid">
            <div class="g-xs4" ng-bind-html="back"></div>
            <div class="g-xs4"><div class="tt">注册</div></div>
            <div class="g-xs4 f-tar" ng-bind-html="next"></div>
        </div>
    </div>
    <div class="g-ct">
        <form name="js_form" type="post"  class="m-form" novalidate ng-submit="regForm()">
            <div ng-hide="step">
                <div class="formitm f-cb">
                <div class="mn">
                    <div class="mnc">
                        <input type="text" name="account" placeholder="手机号" class="input" ng-model="user.phone" required ng-pattern="/^1[3|5|8|7]\d{9}/" ng-change ="hasMobile()"/>
                    </div>
                </div>
                <div class="error" ng-show="js_form.account.$dirty && js_form.account.$invalid">
                    <small class="error" ng-show="js_form.account.$error.required">
                        手机号为必填项.
                    </small>
                    <small class="error" ng-show="js_form.account.$error.pattern">
                        手机号码不正确.
                    </small>
                </div>
            </div>
            <div class="formitm f-cb">
                <div class="mn" style="float:left;">
                    <div class="mnc" style="margin-right:15rem">
                        <input type="text" name="sms" placeholder="验证码" class="input" ng-model="user.randomCode" required ng-minlength="6"  ng-maxlength="6" ng-change="hasError=false"/>
                    </div>
                </div>
                <div class="opt">
                    <a ng-hide="optValue" href="javascript:;" ng-bind-html="js_opt">获取短信验证码</a>
                    <a ng-show="optValue" ng-click="getSms()" class="z-sel" href="javascript:;" ng-bind-html="js_opt">30秒后重新获取</a>
                </div>
                <div class="tip">
                    <div class="error" ng-show="js_form.sms.$dirty && js_form.sms.$invalid">
                        <small class="error" ng-show="js_form.sms.$error.required">
                            验证码为必填项.
                        </small>
                        <small class="error" ng-show="js_form.sms.$error.maxlength">
                            验证码长度不能超过6个字符.
                        </small>
                    </div>
                    <div class="error" ng-show="js_form.sms.$sendError">
                        <small class="error" ng-show="js_form.sms.$sendError">
                            网络出错，请联系管理员.
                        </small>
                    </div>
                    <div class="error" ng-show="hasError">
                        <div class="error" ng-show="hasError" ng-bind-html="hasError"></div>
                    </div>
                </div>
            </div>
            </div>
            <div ng-show="step">
                <div class="formitm f-cb">
                    <div class="mn">
                        <div class="mnc">
                            <input type="password" name="password" class="input" placeholder="密码" ng-model="user.password" required  ng-minlength="3" ng-maxlength="20"/>
                        </div>
                    </div>
                    <div class="error" ng-show="js_form.password.$dirty && js_form.password.$invalid">
                        <small class="error" ng-show="js_form.password.$error.required">
                            密码为必填项.
                        </small>
                        <small class="error" ng-show="js_form.password.$error.minlength">
                            密码长度至少为三个字符.
                        </small>
                        <small class="error" ng-show="js_form.password.$error.maxlength">
                            密码长度不能超过20个字符.
                        </small>
                    </div>
                </div>
                <div class="formitm f-cb">
                    <label class="lab">确认密码：</label>
                    <div class="mn">
                        <div class="mnc">
                            <input type="password" name="repeatPassword" class="input" placeholder="确认密码" ng-model="user.repeatPassword" required ng-change="checkPassword()" ng-class="js_form.repeatPassword.$error.repeat ? '':'ng-valid'"/>
                            <div class="error" ng-show="js_form.repeatPassword.$dirty && js_form.repeatPassword.$invalid">
                                <small class="error" ng-show="js_form.repeatPassword.$error.required">
                                    密码为必填项.
                                </small>
                                <small class="error" ng-show="js_form.repeatPassword.$error.repeat">
                                    两次密码输入不一致.
                                </small>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="formitm">
                <div class="btn s-gay">
                    <a href="javascript:;" class="button" ng-hide="step" ng-click="step= (js_form.sms.$invalid ? 0 : 1)">下一步</a>
                    <button type="submit" ng-show="step" ng-disabled="js_form.account.$dirty && js_form.account.$invalid ||js_form.sms.$dirty && js_form.sms.$invalid || !js_form.password.$dirty && js_form.password.$invalid || !js_form.repeatPassword.$dirty || js_form.repeatPassword.$error.repeat"><span>完成</span></button></div>
            </div>
        </form>
    </div>
</div>